package org.example.two;


import org.example.two.sort.*;

import java.util.Scanner;

/**
 * @outher 刘旭
 * @date 2024/4/30 9:55
 */
public class Main {
    /**
     * 从标准输入中读取数据，并将他们排序输出
     * @param args
     */
    public static void main(String[] args) {
        Example example = new Quick();
        //获取数据
        //String[] a = myScanner();
        Comparable[] a = myRand();

        example.show(a);
        //排序
        example.sort(a);
        //验证有序
        assert example.isSorted(a);
        //打印结果
        example.show(a);

    }
    public static String[] myScanner(){
        Scanner scanner = new Scanner(System.in);
        String[] a =scanner.nextLine().split(" ");
        return a;
    }

    public static Comparable[] myRand(){

        Comparable[] arr = new Comparable[10];
        for (int i = 0; i < 10; i++) {
            arr[i] = (int)(Math.random() * 19 + 1);
        }

        return arr;
    }
}
